package pl.mdziedzic.pagetests;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class HomePage extends Page{

	private final String selfURL = "http://demo.bananascrum.com/projects/test/sprints/4319";
	
	public HomePage(WebDriver driver) {
		super(driver);
	}
	
	public boolean verifySelfURL(String url){
		return selfURL.equals(url);
	}
	
	public boolean selectKleinFromList(String by){
		WebElement selectList = driver.findElement(By.id(by));
		selectList.sendKeys(Keys.ARROW_DOWN, Keys.ARROW_DOWN, Keys.ENTER);
		return driver.getTitle().matches("^[\\s\\S]*Klein[\\s\\S]*$");
	}
}
